#include "processbar.h"
const char* label="|/-\\";


void processbar()
{
  char bar[NUM];
  memset(bar,'\0',sizeof(bar));
  int cnt=0;
  int len=strlen(label);
  while(cnt<=Top)
  {
    printf("[%-100s][%d%%][%c]\r",bar,cnt,label[cnt%len]);
    fflush(stdout);
    bar[cnt++]=STY;
    if(cnt<100)bar[cnt]=Head;
    usleep(50000);
  }
  printf("\n");
}
